import { Body, Controller, Get, Post, Res, HttpStatus, UploadedFile, UseInterceptors, HttpException, Query } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { Response } from 'express';
import { User } from './user.entity';
import { UserService } from './user.service';


import {
  apibefore
} from '../../router'
import utils from 'src/common/utils';
@Controller(apibefore+'/sysuser')
export class UserFuncController {
  constructor(private readonly userFuncService: UserService) {
  }

  //查询用户的wx_user
  async findWxUser(token: number): Promise<{wx_user?: string, error?: HttpException}>{
    let findUser:User = await this.userFuncService.findOne(token)
    if(!findUser){
      return {error:new HttpException('用户不存在',HttpStatus.INTERNAL_SERVER_ERROR)}
    }
    return {wx_user:findUser.wx_user}
  }

}
